package edu.fmi.st.epf.types.projectmember.ui.pages;

import org.eclipse.epf.uma.CustomCategory;
import org.eclipse.ui.forms.editor.FormEditor;

import edu.fmi.st.epf.types.projectmember.common.util.ProjectMemberHelper;
import edu.fmi.st.epf.types.projectmember.ui.ProjectMemberActivator;
import edu.fmi.st.epf.types.projectmember.ui.provider.ProjectMemberItemProvider;
import edu.fmi.st.epf.types.skill.common.util.SkillHelper;
import eu.tanov.epf.pv.service.types.handler.CustomTypeHandler;
import eu.tanov.epf.pv.service.types.service.CustomTypeHandlersService;
import eu.tanov.epf.pv.ui.common.pages.AbstractCustomTypeCategoryPage;
import eu.tanov.epf.pv.ui.common.util.EditorHelper;

public class ProjectMemberSkillsPage  extends AbstractCustomTypeCategoryPage<CustomCategory> {
	private static final String FORM_PAGE_ID = "projectMemberSkillsPage"; //$NON-NLS-1$	

	public ProjectMemberSkillsPage(FormEditor editor) {
		super(editor, FORM_PAGE_ID, "Skills", getTypeHelper(),
				"Skills");
		EditorHelper.updateTitleImage(editor, ProjectMemberItemProvider.getProjectImage());
	}

	private static CustomTypeHandler<CustomCategory> getTypeHelper() {
		final CustomTypeHandlersService service = ProjectMemberActivator.getDefault().getService(
				CustomTypeHandlersService.class);
		return service.getHandlerForType(SkillHelper.getCustomType(), CustomCategory.class);
	}

	@Override
	protected String tabString() {
		// FIXME: filter techniques
		return "Skills";
	}

	@Override
	protected String multipleSelectDescription(int count) {
		return count + "Skills have been selected";
	}

	@Override
	protected String sectionDescription() {
		return "Manage the Skills that belong to this Project Member.";
	}

	@Override
	protected String sectionName() {
		return "Skills";
	}

	@Override
	protected String selectedLabel() {
		return "Skills";
	}

	@Override
	protected String[] modelStructurePath() {
		return ProjectMemberHelper.PROJECT_MEMBERS_PATH;
	}
}
